package com.mike.spring.IOC;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.BeanPostProcessor;

import java.util.Date;

public class DateObj implements BeanPostProcessor,InitializingBean,BeanNameAware {
    private Date date;

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        return o;
    }

    @Override
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        return o;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("DateObj");
    }

    @Override
    public void setBeanName(String s) {
        System.out.println("s = [" + s + "]");
    }
}
